package com.trace.app.controller;


import com.trace.app.entity.ResponseResult;
import com.trace.app.service.OssService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author : lyj
 * @Timer : 2022/12/31
 * @Description :
 */
@Api(tags = "阿里云图片上传")
@RestController
public class AliyunOSSController {
    @Autowired
    private OssService aliyunOSSService;

    @PostMapping("/uploadFile")
    public ResponseResult uploadOssFile(MultipartFile file) {
        String url = aliyunOSSService.uploadFileAvatar(file);
        return ResponseResult.okResult(url);
    }

}
